$def with(new_user)
<h3 class="page-title">用户管理</h3>
<div class="well">
    <h4>录入用户信息</h4>
    <form id="defaultForm" action="/users/create" method="post" class="form-horizontal">
        <div class="control-group">
            <label class="control-label" >登录名</label>
            <div class="controls">
                <input type="text" name="login_name" id="login_name" value="" placeholder="请输入登录名" class="input-xlarge">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >姓名</label>
            <div class="controls">
                <input type="text" name="user_name" id="user_name" value="" placeholder="请输入用户姓名" class="input-xlarge">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >密码</label>
            <div class="controls">
                <input type="password" name="password" id="password" value="" placeholder="请输入密码" class="input-xlarge">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >验证密码</label>
            <div class="controls">
                <input type="password" id="confirm_password" name="confirm_password" placeholder="请再次输入密码"  class="input-xlarge">
            </div>
        </div>
        <div class="control-group">
        <div class="controls">
          <label class="checkbox">
            <input type="checkbox" name="is_admin" id="is_admin" value="is_admin"> 管理员
          </label>
          <button type="submit" class="btn btn-primary">保存</button>
            <a href="/users" data-toggle="modal" class="btn">返回</a>
        </div>
      </div>

    </form>
</div>
<script type="text/javascript">
$$(document).ready(function() {
    $$( "#defaultForm" ).validate( {
        rules: {
            user_name: {
                required: true,
                minlength: 2
            },
            login_name: {
                required: true,
                minlength: 2
            },
            password: {
                required: true,
                minlength: 5
            },
            confirm_password: {
                required: true,
                minlength: 5,
                equalTo: "#password"
            }
        },
        messages: {
            user_name: {
                required: "请输入用户姓名",
                minlength: "用户姓名必须在2个字符以上"
            },
            login_name: {
                required: "请输入登录名",
                minlength: "登录名必须在2个字符以上"
            },
            password: {
                required: "请输入登录密码",
                minlength: "登录密码必须在5个字符以上"
            },
            confirm_password: {
                required: "请再次输入登录密码",
                minlength: "登录密码必须在5个字符以上",
                equalTo: "两次输入的登录密码不一致"
            }
        },
        errorElement: "em",
        errorPlacement: function ( error, element ) {
            // Add the `help-block` class to the error element
            error.addClass( "help-block" );

            if ( element.prop( "type" ) === "checkbox" ) {
                error.insertAfter( element.parent( "label" ) );
            } else {
                error.insertAfter( element );
            }
        },
        highlight: function ( element, errorClass, validClass ) {
            $$( element ).parents( ".controls" ).addClass( "has-error" ).removeClass( "has-success" );
        },
        unhighlight: function (element, errorClass, validClass) {
            $$( element ).parents( ".controls" ).addClass( "has-success" ).removeClass( "has-error" );
        }
    } );

});
</script>